<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
    <meta name="format-detection" content="telephone=no"/>
    <title>会员中心</title>
    <link rel="stylesheet" type="text/css" href="/Public/vendor/font-awesome/css/font-awesome.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/vendor/vex/dist/css/vex.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/vendor/vex/dist/css/vex-theme-top.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/assets/home/css/common.css"/>
</head>
<body>
<header class="member">
    <img class="img-responsive" src="/Public/assets/home/images/background.jpg"/>

    <dl>
        <dt><img class="img-responsive img-circle" src="<?php echo ($customerInfo["thumb"]); ?>" alt="会员头像"/></dt>
        <dd>尊贵的：<?php echo ($customerInfo["nickname"]); ?></dd>
        <dd>会员号：<?php echo ($customerInfo["customer_no"]); ?></dd>
        <dd>入会时间：<?php echo (date("Y-m-d H:i:s", $customerInfo["created_at"])); ?></dd>
        <dd>个性签名：<span id="inputSign"><?php echo ($customerInfo["sign"]); ?></span></dd>
    </dl>

    <span id="edit" class="fa fa-pencil-square-o"></span>

    <a id="share" href=""><i class="fa fa-share-alt"></i> <br/> 分享</a>
</header>

<div class="clearsH"></div>

<ul class="datum">
    <li><a href="<?php echo U('orders',array('status'=>'1'));?>"><strong><?php echo ($daifa); ?></strong> <i class="fa fa-tasks"></i> 待发货</a>
    </li>
    <li><a href="<?php echo U('orders',array('status'=>'2'));?>"><strong><?php echo ($yifa); ?></strong> <i class="fa fa-truck"></i> 已发货</a>
    </li>
    <li><a href="<?php echo U('orders',array('status'=>'3'));?>"><strong><?php echo ($wancheng); ?></strong> <i class="fa fa-th-list"></i>
        已完成</a></li>
</ul>

<a class="link" href="<?php echo U('orders', ['status'=>'all']);?>"><i class="fa fa-shopping-cart"></i> 我的订单</a>

<div class="clearsH"></div>

<a class="link" href="<?php echo U('logistic');?>"><i class="fa fa-list-ol"></i> 物流跟踪</a>

<div class="clearsH"></div>

<a class="link" href="<?php echo U('info', ['id'=>$customerInfo[id]]);?>"><i class="fa fa-user"></i> 修改个人资料</a>
<a class="link" href="<?php echo U('inquiry');?>"><i class="fa fa-money"></i> 会员充值</a>

<div class="footer">
    <p>
        <a href="<?php echo U('Index/index');?>">商城首页</a>
        <a href="<?php echo U('Cart/index');?>">购物车</a>
        <a href="<?php echo U('Customer/index');?>">会员中心</a>
    </p>

    <dl>
        <dt><a href="javascript:void(0);">
            <img class="img-responsive" src="/Public/assets/home/images/favicon.ico"
                                               alt="长乐美食城"/></a></dt>
        <dd><a href="javascript:void(0);">武汉长乐未央网络科技有限公司提供技术支持</a></dd>
    </dl>
</div>

<script type="text/javascript" src="/Public/assets/home/js/jquery.min.js"></script>
<script type="text/javascript" src="/Public/vendor/vex/dist/js/vex.combined.min.js"></script>
<script type="text/javascript">
    $(function () {
        //编辑个性签名
        $('#edit').bind('click', function () {
            var signStr = $('#inputSign').text();
            vex.dialog.open({
                className: "vex-theme-top",
                message: '编辑个性签名',
                input: '<textarea placeholder="请填写个性签名" name="sign" id="sign" style="height: 120px; line-height: 24px; resize: none;"></textarea>',
                buttons: [
                    $.extend({}, vex.dialog.buttons.YES, {
                        text: '保存'
                    }), $.extend({}, vex.dialog.buttons.NO, {
                        text: '返回'
                    })
                ],
                callback: function (data) {
                    if (data) {
                        var sign = $("#sign").val();
//                        console.log(sign);return;
                        $.post("<?php echo U('editSign');?>", {
                            sign: sign
                        }, function (data) {
                            if (data.status == 1) {
                                $("#inputSign").text($.trim(sign));
                            }
                        })
                    }
                }
            });
            return false;
        });

    });
</script>
</body>
</html>